
<template>
  <div class="home">
    <div v-if='isLoading'>
      <PreLoading
      v-for="item in preLoadingNum"
      :key="item"
      />
    </div>
    <div v-if='!isLoading'>
          <div class="app" :style="{ height: contentHeight + 'px' }">
      <div class="banner">
        <div><img :src="require('@@/assets/wk.png')" class="imege" /></div>
      </div>
      <div class="content">
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
        <div>上下结构</div>
      </div>
    </div>
    <div ref="foot" class="foot">
      <Footer page="my" />
    </div>
    </div>
  </div>
</template>
<script>
import Footer from '@@/components/Footer'
import mixin from '@@/mixin/contentHeight'
import { post } from '@/methods/net'
import {
  USER_SET_WX_USERINFO,
  USER_SET_WX_USERINFOEND
} from '../api/api'
import { mapGetters } from 'vuex'
export default {
  mixins: [mixin],
  components: {
    Footer
  },
  data () {
    return {
      isLoading: false,
      preLoadingNum: [1, 2, 3, 4, 5]
    }
  },
  created () {
    console.log('打印----------', this.$store)
    let params = {
      value: '22'
    }
    this.$store.dispatch('getOpenId', params)
  },
  mounted () {
    this.frist()
    this.senconde()
    console.log('我是第几个出来===')
  },
  computed: {
    ...mapGetters(['username'])
  },
  methods: {
    async frist () {
      const res = await post(USER_SET_WX_USERINFO)
      console.log('====USER_SET_WX_USERINFO', res)
    },
    senconde () {
      const res = post(USER_SET_WX_USERINFOEND)
      console.log('USER_SET_WX_USERINFOEND====', res)
    }

  }
}
</script>

<style lang="less" scoped>
.home {
  position: relative;
  width: 100%;
}
.app {
  width: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overflow: scroll;
  .banner {
    img {
      height: 5rem;
      width: 100%;
    }
  }
}
.foot {
  position: absolute;
  width: 100%;
  ul {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.2rem;
    li{
      flex: 1;
      height: 1rem;
    }
  }
}
</style>
